<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="en" class="no-js" id="ng-app">
<head>
<meta charset="UTF-8">
<jsp:include page="/includes/common/head.jsp" />
<title>CS4280 BOOKSTORE</title>
</head>
<body>
	<div data-flex-background-src="${ baseURL }/assets/img/background.jpg"
		flex-background></div>
	<jsp:include page="/includes/header.jsp">
		<jsp:param name="currentUser" value="${currentUser}" /><jsp:param name="baseURL" value="${ baseURL }" />
	</jsp:include>
	<section id="mainContent">
		<jsp:include page="/includes/admin/sidebar.jsp" />
		<section class="content">
			<c:if test="${action!=null && action=='accept' }">
				Refund request of Invoice (ID: ${request_invoice.id}) has been accepted successfully! 
			</c:if>
	
				<c:if test="${action!=null && action=='reject' }">
				Refund request of Invoice (ID: ${request_invoice.id}) has been rejected successfully! 
			</c:if>
			<table class="shush-table">
				<tr class="table_header">
					<td>TRANSACTION ID</td>
					<td>BOOK NAME</td>
					<td>DATE</td>
					<c:if test="${view != null && view != 'list'}">
						<td>REQUEST</td>
					</c:if>
				</tr>
				<c:forEach var="invoice" items="${invoiceList}" varStatus="invoiceIndex">
					<tr>
						<td>${invoice.id}</td>
						<td>${bookList[invoiceIndex.index].title}</td>
						<td>${invoice.date}</td>
						<c:if test="${view != null && view != 'list'}">
							<td>
								<form
									action="${ baseURL }/admin/manage/refund?action=accept&id=${ invoice.id }"
									method="post">
									<input type="submit" name="refund" value="ACCEPT">
								</form>
								<form
									action="${ baseURL }/admin/manage/refund?action=reject&id=${ invoice.id }"
									method="post">
									<input type="submit" name="refund" value="REJECT">
								</form>
							</td>
						</c:if>
					</tr>
				</c:forEach>
			</table>
			</section>
	</section>
</body>
</html>